package com.hqq.action.clazz.iterator;

/**
 * MyCollection
 * Created by heqianqian on 2017/3/11.
 */
public class MyCollection implements Collection {

    private String[] strings = {"aaa","bbb","ccc"};

    private Iterator iterator;

    public MyCollection() {
        iterator = new MyIterator(this);
    }

    @Override
    public Iterator iterator() {
        return iterator;
    }

    @Override
    public Object get(int i) {
        return strings[i];
    }

    @Override
    public int size() {
        return strings.length;
    }
}
